<?php

	$rawTweet = "Something bad happened...";
	if (isset($_REQUEST['rawtweet']))
		$rawTweet = strtolower(stripslashes($_REQUEST['rawtweet']));



//get the tweet

$map = "images/sheet1.jpg";
$note = "images/note.gif";

	header("Content-type: image/jpeg");	
	$img = ImageCreateFromjpeg($map);

	$imgnote = imagecreatefromgif($note);

	$color = '000000';
		$int = hexdec($color);
		$arr = array("red" => 0xFF & ($int >> 0x10),
		"green" => 0xFF & ($int >> 0x8),
		"blue" => 0xFF & $int);
	
		$clr = ImageColorAllocate($img, $arr["red"], $arr["green"], $arr["blue"]); 
	

	$strlen = strlen($rawTweet);

	$ix = 50;
	$iy = 16;
	for($i=0;$i<$strlen;$i++)
	{
		if (strcmp($rawTweet[$i], "a"))
		{
			$iy = 200;
		}
		//imagechar($img, 1, $ix, $iy, "♪", $clr);
		imagecopy($img, $imgnote, $ix, $iy, 0, 0, 12, 20);
		$ix= $ix + 8;
		
	}

	Imagejpeg($img); 


ImageDestroy($img);  //
ImageDestroy($imgnote);  //  

?> 
 
